#ifndef __INKLUDE_C_TCP_SERVER_H__
#define __INKLUDE_C_TCP_SERVER_H__

#include <Inklude/Inklude.h>
#include <Inklude/ikCTcpClient.h>
#include <memory>


namespace Inklude
{
    namespace Internal
    {
        class ikCTcpBoost;
    }

    class INKLUDE_CLASS_EXPORT ikCTcpServer
    {
    public:
        typedef std::shared_ptr<std::function<void (ikCTcpClientPtr)> > CheckNewConnectionHandler;

        ikCTcpServer();
        ~ikCTcpServer();
        bool OpenServer(unsigned int nPort);
        const ikCTcpClientPtr CheckNewConnection();
        void AsyncCheckNewConnection(CheckNewConnectionHandler endHandler);

    protected:
        const ikCTcpClientPtr _getAcceptedClientPtr();

    private:
        unsigned int m_nListenPort;
        std::shared_ptr<Inklude::Internal::ikCTcpBoost> m_pTcp;
    };
}

#endif // __INKLUDE_C_TCP_SERVER_H__

